home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / protocol / standard / scsi / scsi1_do.4 < prev    next >
Internet Message Format  |  1993-07-14  |  111KB

  1. From coffin@ROCKY2.ROCKEFELLER.EDU Thu Mar 22 08:25:17 1990
  2. Flags: 000000000001
  3. Return-Path: <coffin@ROCKY2.ROCKEFELLER.EDU>
  4. Received: from ROCKY2.ROCKEFELLER.EDU by rascal.ics.utexas.edu. (4.0/SMI-4.0)
  5.     id AA28478; Thu, 22 Mar 90 08:25:00 CST
  6. Received: by ROCKY2.ROCKEFELLER.EDU (5.61/1.34)
  7.     id AA14951; Thu, 22 Mar 90 09:24:36 -0500
  8. Message-Id: <9003221424.AA14951@ROCKY2.ROCKEFELLER.EDU>
  9. To: werner@rascal.ics.utexas.edu
  10. Subject: scsiDixxocsPart4 of 7
  11. Date: Thu, 22 Mar 90 09:24:17 -0500
  12. From: coffin@ROCKY2.ROCKEFELLER.EDU
  13.  
  14.  
  15.  
  16. .fo Section 8                            #
  17. 8. Command Descriptions for Direct-Access Devices
  18.  
  19. 8.1 Group 0 Commands for Direct-Access Devices.  The Group 0 commands for 
  20. direct-access devices shall be as shown in Table 8-1.
  21.  
  22.                                   Table 8-1
  23.                   Group 0 Commands for Direct-Access Devices
  24.  
  25. ==============================================================================
  26. Operation
  27.   Code      Type   Command Name                       Section
  28. ------------------------------------------------------------------------------
  29.    00H       O     TEST UNIT READY                    7.1.1
  30.    01H       O     REZERO UNIT                        8.1.1
  31.    02H       V
  32.    03H       M     REQUEST SENSE                      7.1.2
  33.    04H       M     FORMAT UNIT                        8.1.2
  34.    05H       V
  35.    06H       V
  36.    07H       O     REASSIGN BLOCKS                    8.1.3
  37.    08H       M     READ                               8.1.4
  38.    09H       V
  39.    0AH       M     WRITE                              8.1.5
  40.    0BH       O     SEEK                               8.1.6
  41.    0CH       V
  42.    0DH       V
  43.    0EH       V
  44.    0FH       V
  45.    10H       V
  46.    11H       V
  47.    12H       E     INQUIRY                            7.1.3
  48.    13H       V
  49.    14H       V
  50.    15H       O     MODE SELECT                        8.1.7
  51.    16H       O     RESERVE                            8.1.8
  52.    17H       O     RELEASE                            8.1.9
  53.    18H       O     COPY                               7.1.4
  54.    19H       V
  55.    1AH       O     MODE SENSE                         8.1.10
  56.    1BH       O     START/STOP UNIT                    8.1.11
  57.    1CH       O     RECEIVE DIAGNOSTIC RESULTS         7.1.5
  58.    1DH       O     SEND DIAGNOSTIC                    7.1.6
  59.    1EH       O     PREVENT/ALLOW MEDIUM REMOVAL       8.1.12
  60.    1FH       R
  61. ==============================================================================
  62.  
  63. Key: M  =  Command implementation is mandatory.
  64.      E  =  Command implementation is required for SCSI devices that support 
  65.            device-independent self-configuring software.
  66.      O  =  Command implementation is optional.
  67.      R  =  Operation code is reserved for future standardization.
  68.      V  =  Operation code is available for vendor unique commands.
  69. .pa
  70.  
  71.   8.1.1 REZERO UNIT Command
  72.  
  73.      Peripheral Device Type:  Direct Access
  74.         Operation Code Type:  Optional
  75.              Operation Code:  01H
  76.  
  77.                                   Table 8-2
  78.                              REZERO UNIT Command
  79.  
  80. ==============================================================================
  81.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  82. Byte |        |        |        |        |        |        |        |        |
  83. ==============================================================================
  84.  0   |                           Operation Code                              | 
  85. -----|-----------------------------------------------------------------------|
  86.  1   | Logical Unit Number      |                  Reserved                  |
  87. -----|-----------------------------------------------------------------------|
  88.  2   |                           Reserved                                    |
  89. -----|-----------------------------------------------------------------------|
  90.  3   |                           Reserved                                    |
  91. -----|-----------------------------------------------------------------------|
  92.  4   |                           Reserved                                    |
  93. -----|-----------------------------------------------------------------------|
  94.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  95. ==============================================================================
  96.  
  97.   The REZERO UNIT command (Table 8-2) requests that the target set the logical 
  98. unit to a specific state.  See vendor specifications for details.
  99.  
  100.   8.1.2 FORMAT UNIT Command
  101.  
  102.      Peripheral Device Type:  Direct Access
  103.         Operation Code Type:  Mandatory
  104.              Operation Code:  04H
  105.  
  106.                                   Table 8-3
  107.                              FORMAT UNIT Command
  108.  
  109. ==============================================================================
  110.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  111. Byte |        |        |        |        |        |        |        |        |
  112. ==============================================================================
  113.  0   |                           Operation Code                              | 
  114. -----|-----------------------------------------------------------------------|
  115.  1   | Logical Unit Number      | FmtData| CmpLst |   Defect List Format     |
  116. -----|-----------------------------------------------------------------------|
  117.  2   |                           Vendor Unique                               |
  118. -----|-----------------------------------------------------------------------|
  119.  3   |                           Interleave (MSB)                            |
  120. -----|-----------------------------------------------------------------------|
  121.  4   |                           Interleave (LSB)                            |
  122. -----|-----------------------------------------------------------------------|
  123.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  124. ==============================================================================
  125. .pa
  126.  
  127.   The FORMAT UNIT command (Table 8-3) ensures that the medium is formatted so 
  128. that all data blocks can be accessed.  There is no guarantee that the medium 
  129. has or has not been altered.  In addition, the medium may be certified and 
  130. control structures be created for the management of the medium and defects.
  131.  
  132.   The FORMAT UNIT command is both a mandatory command and an extended command 
  133. with multiple options (see Table 8-4).
  134.  
  135.   The FORMAT UNIT command shall be rejected with RESERVATION CONFLICT status 
  136. if any extent (see 8.1.8.2) in the specified logical unit is reserved.
  137.  
  138.   A format data (FmtData) bit of one indicates that format data is supplied 
  139. during the DATA OUT phase.  The defect list included with this data specifies 
  140. the defects that shall be entered into the defect map.  The format of the 
  141. defect list is determined by defect list format.  A FmtData bit of zero 
  142. indicates that the DATA OUT phase shall not occur (no defect data shall be 
  143. supplied by the initiator).
  144.  
  145.   A complete list (CmpLst) bit of one indicates the data supplied is the 
  146. complete list of known defects.  Any previous initiator-specified defect map 
  147. or defect data shall be erased.  The target may add to this list as it formats 
  148. the medium.  The result is to purge any previous initiator-specified defect 
  149. list and to build a new defect list.  A CmpLst bit of zero indicates that the 
  150. data supplied is in addition to existing defect data using the current format.  
  151. When using the block format, the defect list refers to the current block 
  152. length (and not to the new block length, if it is different) and the defect 
  153. list refers to current logical block addresses (not physical addresses).  The 
  154. target may add to this list as it formats the medium.
  155.  
  156.   The defect list format field specifies additional information related to the 
  157. defect list.  (See Table 8-4 for further information.)
  158.  
  159.   The interleave field requests that the logical blocks be related in a 
  160. specific fashion to the physical blocks to facilitate speed matching.  An 
  161. interleave value of zero requests that the target use its default interleave.  
  162. An interleave value of one requests that consecutive logical blocks be placed 
  163. in consecutive physical order.  Values of two or greater are vendor unique.
  164. .pa
  165.  
  166.                                   Table 8-4
  167.                         FORMAT UNIT Command Variations
  168.  
  169. ==============================================================================
  170.     Bit Reference
  171. ---------------------
  172. 4    3    2    1    0
  173. FmtData
  174. |    CmpLst
  175. |    |    Defect List
  176. |    |      Format
  177. |    |    |    |    |    Command Type   Comments
  178. ---------------------    ------------   --------------------------------------
  179. 0    X    X    X    X    Mandatory      Format with no defect data sent from 
  180.                                         the initiator to the target.
  181.  
  182. 1    0    0    X    X    Extended       Format adding the defects specified in 
  183.                                         the defect list to the known defects.  
  184.                                         (See Table 8-5.)
  185.  
  186. 1    1    0    X    X    Optional       Format using defects in the defect 
  187.                                         list as the full set of known defects.  
  188.                                         (See Table 8-5.)
  189.  
  190. 1    0    1    0    0    Optional       Format adding the defects in the 
  191.                                         defect list to the known defects.  
  192.                                         (See Table 8-6.)
  193.  
  194. 1    1    1    0    0    Optional       Format using the defects in the defect 
  195.                                         list as the full set of known defects.  
  196.                                         (See Table 8-6.)
  197.  
  198. 1    0    1    0    1    Optional       Format adding the defects in the 
  199.                                         defect list to the known defects.  
  200.                                         (See Table 8-7.)
  201.  
  202. 1    1    1    0    1    Optional       Format using the defects in the defect 
  203.                                         list as the full set of known defects.  
  204.                                         (See Table 8-7.)
  205.  
  206. 1    X    1    1    0    Vendor unique
  207.  
  208. 1    0    1    1    1    Reserved
  209.  
  210. 1    1    1    1    1    Reserved
  211. ==============================================================================
  212.  
  213. X = 1 or 0 (i.e., don't care term).
  214. .pa
  215.  
  216.   The defect lists shown in Tables 8-5, 8-6, and 8-7 contain a four-byte 
  217. header followed by one or more defect descriptors.  The length of the defect 
  218. descriptors vary with the format of the defect list.
  219.  
  220.   The defect list length in each table specifies the total length in bytes of 
  221. the defect descriptors that follow.  In Table 8-5, the defect list length is 
  222. equal to four times the number of defect descriptors.  In Tables 8-6 and 8-7, 
  223. the defect list length is equal to eight times the number of defect 
  224. descriptors.
  225.  
  226.                                   Table 8-5
  227.                           Defect List - Block Format
  228.  
  229. ==============================================================================
  230. Byte |                        Defect List Header                             |
  231. ==============================================================================
  232.  0   |                           Reserved                                    |
  233. -----|-----------------------------------------------------------------------|
  234.  1   |                           Reserved                                    |
  235. -----|-----------------------------------------------------------------------|
  236.  2   |                           Defect List Length (MSB)                    |
  237. -----|-----------------------------------------------------------------------|
  238.  3   |                           Defect List Length (LSB)                    |
  239. ==============================================================================
  240.      |                        Defect Descriptor(s)                           |
  241. ==============================================================================
  242.  0   |                           Defect Block Address (MSB)                  |
  243. -----|-----------------------------------------------------------------------|
  244.  1   |                           Defect Block Address                        |
  245. -----|-----------------------------------------------------------------------|
  246.  2   |                           Defect Block Address                        |
  247. -----|-----------------------------------------------------------------------|
  248.  3   |                           Defect Block Address (LSB)                  |
  249. ==============================================================================
  250.  
  251.   Each defect descriptor for the block format specifies a four-byte defect 
  252. block address that contains the defect.  The defect descriptors shall be in 
  253. ascending order.
  254. .pa
  255.  
  256.                                   Table 8-6
  257.                     Defect List - Bytes From Index Format
  258.  
  259. ==============================================================================
  260. Byte |                        Defect List Header                             |
  261. ==============================================================================
  262.  0   |                           Reserved                                    |
  263. -----|-----------------------------------------------------------------------|
  264.  1   |                           Reserved                                    |
  265. -----|-----------------------------------------------------------------------|
  266.  2   |                           Defect List Length (MSB)                    |
  267. -----|-----------------------------------------------------------------------|
  268.  3   |                           Defect List Length (LSB)                    |
  269. ==============================================================================
  270.      |                        Defect Descriptor(s)                           |
  271. ==============================================================================
  272.  0   |                           Cylinder Number of Defect (MSB)             |
  273. -----|-----------------------------------------------------------------------|
  274.  1   |                           Cylinder Number of Defect                   |
  275. -----|-----------------------------------------------------------------------|
  276.  2   |                           Cylinder Number of Defect (LSB)             |
  277. -----|-----------------------------------------------------------------------|
  278.  3   |                           Head Number of Defect                       |
  279. -----|-----------------------------------------------------------------------|
  280.  4   |                           Defect Bytes from Index (MSB)               |
  281. -----|-----------------------------------------------------------------------|
  282.  5   |                           Defect Bytes from Index                     |
  283. -----|-----------------------------------------------------------------------|
  284.  6   |                           Defect Bytes from Index                     |
  285. -----|-----------------------------------------------------------------------|
  286.  7   |                           Defect Bytes from Index (LSB)               |
  287. ==============================================================================
  288.  
  289.   Each defect descriptor for the bytes from index format specifies the 
  290. beginning of an eight-byte defect location on the medium.  Each defect 
  291. descriptor is comprised of the cylinder number of defect, the head number of 
  292. defect, and the defect bytes from index.  The defect descriptors shall be in 
  293. ascending order.  For determining ascending order, the cylinder number of 
  294. defect is considered the most significant part of the address and the defect 
  295. bytes from index is considered the least significant part of the address.
  296.  
  297.   A defect bytes from index of FFFFFFFFH indicates that the entire track shall 
  298. be reassigned.
  299. .pa
  300.  
  301.                                   Table 8-7
  302.                      Defect List - Physical Sector Format
  303.  
  304. ==============================================================================
  305. Byte |                        Defect List Header                             |
  306. ==============================================================================
  307.  0   |                           Reserved                                    |
  308. -----|-----------------------------------------------------------------------|
  309.  1   |                           Reserved                                    |
  310. -----|-----------------------------------------------------------------------|
  311.  2   |                           Defect List Length (MSB)                    |
  312. -----|-----------------------------------------------------------------------|
  313.  3   |                           Defect List Length (LSB)                    |
  314. ==============================================================================
  315.      |                        Defect Descriptor(s)                           |
  316. ==============================================================================
  317.  0   |                           Cylinder Number of Defect (MSB)             |
  318. -----|-----------------------------------------------------------------------|
  319.  1   |                           Cylinder Number of Defect                   |
  320. -----|-----------------------------------------------------------------------|
  321.  2   |                           Cylinder Number of Defect (LSB)             |
  322. -----|-----------------------------------------------------------------------|
  323.  3   |                           Head Number of Defect                       |
  324. -----|-----------------------------------------------------------------------|
  325.  4   |                           Defect Sector Number (MSB)                  |
  326. -----|-----------------------------------------------------------------------|
  327.  5   |                           Defect Sector Number                        |
  328. -----|-----------------------------------------------------------------------|
  329.  6   |                           Defect Sector Number                        |
  330. -----|-----------------------------------------------------------------------|
  331.  7   |                           Defect Sector Number (LSB)                  |
  332. ==============================================================================
  333.  
  334.   Each defect descriptor for the physical sector format specifies a sector-
  335. size defect location comprised of the cylinder number of defect, the head 
  336. number of defect, and the defect sector number.  The defect descriptors shall 
  337. be in ascending order.  For determining ascending order, the cylinder number 
  338. of defect is considered the most significant part of the address and the 
  339. defect sector number is considered the least significant part of the address.
  340.  
  341.   A defect sector number of FFFFFFFFH indicates that the entire track shall be 
  342. reassigned.
  343. .pa
  344.  
  345.   8.1.3 REASSIGN BLOCKS Command
  346.  
  347.      Peripheral Device Type:  Direct Access and Write-Once Read-Multiple
  348.         Operation Code Type:  Optional
  349.              Operation Code:  07H
  350.  
  351.                                   Table 8-8
  352.                            REASSIGN BLOCKS Command
  353.  
  354. ==============================================================================
  355.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  356. Byte |        |        |        |        |        |        |        |        |
  357. ==============================================================================
  358.  0   |                           Operation Code                              | 
  359. -----|-----------------------------------------------------------------------|
  360.  1   | Logical Unit Number      |                  Reserved                  |
  361. -----|-----------------------------------------------------------------------|
  362.  2   |                           Reserved                                    |
  363. -----|-----------------------------------------------------------------------|
  364.  3   |                           Reserved                                    |
  365. -----|-----------------------------------------------------------------------|
  366.  4   |                           Reserved                                    |
  367. -----|-----------------------------------------------------------------------|
  368.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  369. ==============================================================================
  370.  
  371.   The REASSIGN BLOCKS command (Table 8-8) requests the target to reassign the 
  372. defective logical blocks to an area on the logical unit reserved for this 
  373. purpose.
  374.  
  375.   The initiator transfers a defect list that contains the logical block 
  376. addresses to be reassigned.  The target shall reassign the physical medium 
  377. used for each logical block address in the list.  The data contained in the 
  378. logical blocks specified in the defect list may be altered, but the data in 
  379. all other logical blocks on the medium shall be preserved.
  380.  
  381.   The effect of specifying a logical block to be reassigned that previously 
  382. has been reassigned is to reassign the block again.  Thus, over the life of 
  383. the medium, a logical block can be assign to multiple physical addresses 
  384. (until no more spare locations remain on the medium).
  385.  
  386.   The REASSIGN BLOCKS defect list (Table 8-9) contains a four-byte header 
  387. followed by one or more defect descriptors.  The length of each defect 
  388. descriptor is four bytes.
  389.  
  390.   The defect list length specifies the total length in bytes of the defect 
  391. descriptors that follow.  The defect list length is equal to four times the 
  392. number of defect descriptors.
  393. .pa
  394.  
  395.                                   Table 8-9
  396.                          REASSIGN BLOCKS Defect List
  397.  
  398. ==============================================================================
  399. Byte |                        Defect List Header                             |
  400. ==============================================================================
  401.  0   |                           Reserved                                    |
  402. -----|-----------------------------------------------------------------------|
  403.  1   |                           Reserved                                    |
  404. -----|-----------------------------------------------------------------------|
  405.  2   |                           Defect List Length (MSB)                    |
  406. -----|-----------------------------------------------------------------------|
  407.  3   |                           Defect List Length (LSB)                    |
  408. ==============================================================================
  409.      |                        Defect Descriptor(s)                           |
  410. ==============================================================================
  411.  0   |                           Defect Logical Block Address (MSB)          |
  412. -----|-----------------------------------------------------------------------|
  413.  1   |                           Defect Logical Block Address                |
  414. -----|-----------------------------------------------------------------------|
  415.  2   |                           Defect Logical Block Address                |
  416. -----|-----------------------------------------------------------------------|
  417.  3   |                           Defect Logical Block Address (LSB)          |
  418. ==============================================================================
  419.  
  420.   The defect descriptor specifies a four-byte defect logical block address 
  421. that contains the defect.  The defect descriptors shall be in ascending order.
  422.  
  423.   If the logical unit has insufficient capacity to reassign all of the 
  424. defective logical blocks, the command shall terminate with a CHECK CONDITION 
  425. status and the sense key shall be set to MEDIUM ERROR.  The logical block 
  426. address of the first logical block not reassigned shall be returned in the 
  427. information bytes of the sense data.
  428. .pa
  429.  
  430.   8.1.4 READ Command
  431.  
  432.      Peripheral Device Type:  Direct Access
  433.         Operation Code Type:  Mandatory
  434.              Operation Code:  08H
  435.  
  436.                                   Table 8-10
  437.                                  READ Command
  438.  
  439. ==============================================================================
  440.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  441. Byte |        |        |        |        |        |        |        |        |
  442. ==============================================================================
  443.  0   |                           Operation Code                              | 
  444. -----|-----------------------------------------------------------------------|
  445.  1   | Logical Unit Number      |Logical Block Address (MSB)                 |
  446. -----|-----------------------------------------------------------------------|
  447.  2   |                           Logical Block Address                       |
  448. -----|-----------------------------------------------------------------------|
  449.  3   |                           Logical Block Address (LSB)                 |
  450. -----|-----------------------------------------------------------------------|
  451.  4   |                           Transfer Length                             |
  452. -----|-----------------------------------------------------------------------|
  453.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  454. ==============================================================================
  455.  
  456.   The READ command (Table 8-10) requests that the target transfer data to the 
  457. initiator.
  458.  
  459.   The logical block address specifies the logical block at which the read 
  460. operation shall begin.
  461.  
  462.   The transfer length specifies the number of contiguous logical blocks of 
  463. data to transferred.  A transfer length of zero indicates that 256 logical 
  464. blocks shall be transferred.  Any other value indicates the number of logical 
  465. blocks that shall be transferred.
  466.  
  467.   The most recent data value written in the addressed logical block shall be 
  468. returned.
  469.  
  470.   This command shall be terminated with a RESERVATION CONFLICT status if any 
  471. reservation access conflict (see 8.1.8) exists and no data shall be read.
  472.  
  473.   If any of the following conditions occur, this command shall be terminated 
  474. with a CHECK CONDITION status, and if extended sense is implemented, the sense 
  475. key shall be set as indicated in the following table.  This table does not 
  476. provide an exhaustive enumeration of all conditions that may cause the CHECK 
  477. CONDITION status.
  478. .pa
  479.  
  480. Condition                                         Sense Key
  481. ----------------------------------------------    ----------------------------
  482. Invalid logical block address                     ILLEGAL REQUEST (see note)
  483.  
  484. Target reset or medium change since
  485. last command from this initiator                  UNIT ATTENTION
  486.  
  487. Unrecoverable read error                          MEDIUM ERROR
  488.  
  489. Recovered read error                              RECOVERED ERROR
  490.  
  491. Overrun or other error that might
  492. be resolved by repeating the command              ABORTED COMMAND
  493.  
  494. NOTE:  The extended sense information bytes shall be set to the logical block 
  495. address of the first invalid address.
  496.  
  497.   8.1.5 WRITE Command
  498.  
  499.      Peripheral Device Type:  Direct Access
  500.         Operation Code Type:  Mandatory
  501.              Operation Code:  0AH
  502.  
  503.                                   Table 8-11
  504.                                 WRITE Command
  505.  
  506. ==============================================================================
  507.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  508. Byte |        |        |        |        |        |        |        |        |
  509. ==============================================================================
  510.  0   |                           Operation Code                              | 
  511. -----|-----------------------------------------------------------------------|
  512.  1   | Logical Unit Number      |Logical Block Address (MSB)                 |
  513. -----|-----------------------------------------------------------------------|
  514.  2   |                           Logical Block Address                       |
  515. -----|-----------------------------------------------------------------------|
  516.  3   |                           Logical Block Address (LSB)                 |
  517. -----|-----------------------------------------------------------------------|
  518.  4   |                           Transfer Length                             |
  519. -----|-----------------------------------------------------------------------|
  520.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  521. ==============================================================================
  522.  
  523.   The WRITE command (Table 8-11) requests that the target write the data 
  524. transferred by the initiator to the medium.
  525.  
  526.   The logical block address specifies the logical block at which the write 
  527. operation shall begin.
  528.  
  529.   The transfer length specifies the number of contiguous logical blocks of 
  530. data to transferred.  A transfer length of zero indicates that 256 logical 
  531. blocks shall be transferred.  Any other value indicates the number of logical 
  532. blocks that shall be transferred.
  533. .pa
  534.  
  535.   This command shall be terminated with a RESERVATION CONFLICT status if any 
  536. reservation access conflict (see 8.1.8) exists and no data shall be written.
  537.  
  538.   If any of the following conditions occur, this command shall be terminated 
  539. with a CHECK CONDITION status, and if extended sense is implemented, the sense 
  540. key shall be set as indicated in the following table.  This table does not 
  541. provide an exhaustive enumeration of all conditions that may cause the CHECK 
  542. CONDITION status.
  543.  
  544. Condition                                         Sense Key
  545. ----------------------------------------------    ----------------------------
  546. Invalid logical block address                     ILLEGAL REQUEST (see note)
  547.  
  548. Target reset or medium change since
  549. last command from this initiator                  UNIT ATTENTION
  550.  
  551. Overrun or other error that might
  552. be resolved by repeating the command              ABORTED COMMAND
  553.  
  554. NOTE:  The extended sense information bytes shall be set to the logical block 
  555. address of the first invalid address.  In this case, no data shall be 
  556. written on the logical unit.
  557.  
  558.   8.1.6 SEEK Command
  559.  
  560.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  561.                               Read-Only Direct Access
  562.         Operation Code Type:  Optional
  563.              Operation Code:  0BH
  564.  
  565.                                   Table 8-12
  566.                                  SEEK Command
  567.  
  568. ==============================================================================
  569.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  570. Byte |        |        |        |        |        |        |        |        |
  571. ==============================================================================
  572.  0   |                           Operation Code                              | 
  573. -----|-----------------------------------------------------------------------|
  574.  1   | Logical Unit Number      |Logical Block Address (MSB)                 |
  575. -----|-----------------------------------------------------------------------|
  576.  2   |                           Logical Block Address                       |
  577. -----|-----------------------------------------------------------------------|
  578.  3   |                           Logical Block Address (LSB)                 |
  579. -----|-----------------------------------------------------------------------|
  580.  4   |                           Reserved                                    |
  581. -----|-----------------------------------------------------------------------|
  582.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  583. ==============================================================================
  584.  
  585.   The SEEK command (Table 8-12) requests that the logical unit seek to the 
  586. specified logical block address.
  587. .pa
  588.  
  589.   8.1.7 MODE SELECT Command
  590.  
  591.      Peripheral Device Type:  Direct Access
  592.         Operation Code Type:  Optional
  593.              Operation Code:  15H
  594.  
  595.                                   Table 8-13
  596.                              MODE SELECT Command
  597.  
  598. ==============================================================================
  599.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  600. Byte |        |        |        |        |        |        |        |        |
  601. ==============================================================================
  602.  0   |                           Operation Code                              | 
  603. -----|-----------------------------------------------------------------------|
  604.  1   | Logical Unit Number      |                  Reserved                  |
  605. -----|-----------------------------------------------------------------------|
  606.  2   |                           Reserved                                    |
  607. -----|-----------------------------------------------------------------------|
  608.  3   |                           Reserved                                    |
  609. -----|-----------------------------------------------------------------------|
  610.  4   |                           Parameter List Length                       |
  611. -----|-----------------------------------------------------------------------|
  612.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  613. ==============================================================================
  614.  
  615.   The MODE SELECT command (Table 8-13) provides a means for the initiator to 
  616. specify medium, logical unit, or peripheral device parameters to the target.
  617.  
  618.   The  parameter list length specifies the length in bytes of the MODE SELECT 
  619. parameter list that shall be transferred during the DATA OUT phase.  A 
  620. parameter list length of zero indicates that no data shall be transferred.  
  621. This condition shall not be considered as an error.
  622.  
  623.   The MODE SELECT parameter list (Table 8-14) contains a four-byte header, 
  624. followed by zero or more block descriptors, followed by the vendor unique 
  625. parameters, if any.
  626. .pa
  627.  
  628.                                   Table 8-14
  629.                           MODE SELECT Parameter List
  630.  
  631. ==============================================================================
  632. Byte |                        MODE SELECT Header                             |
  633. ==============================================================================
  634.  0   |                           Reserved                                    |
  635. -----|-----------------------------------------------------------------------|
  636.  1   |                           Medium Type                                 |
  637. -----|-----------------------------------------------------------------------|
  638.  2   |                           Reserved                                    |
  639. -----|-----------------------------------------------------------------------|
  640.  3   |                           Block Descriptor Length                     |
  641. ==============================================================================
  642.      |                        Block  Descriptor(s)                           |
  643. ==============================================================================
  644.  0   |                           Density Code                                |
  645. -----|-----------------------------------------------------------------------|
  646.  1   |                           Number of Blocks (MSB)                      |
  647. -----|-----------------------------------------------------------------------|
  648.  2   |                           Number of Blocks                            |
  649. -----|-----------------------------------------------------------------------|
  650.  3   |                           Number of Blocks (LSB)                      |
  651. -----|-----------------------------------------------------------------------|
  652.  4   |                           Reserved                                    |
  653. -----|-----------------------------------------------------------------------|
  654.  5   |                           Block Length (MSB)                          |
  655. -----|-----------------------------------------------------------------------|
  656.  6   |                           Block Length                                |
  657. -----|-----------------------------------------------------------------------|
  658.  7   |                           Block Length (LSB)                          |
  659. ==============================================================================
  660.      |                        Vendor Unique Parameter(s)                     |
  661. ==============================================================================
  662. 0 _ n|                           Vendor Unique                               |
  663.      |                           Parameter Byte(s)                           |
  664. ==============================================================================
  665. .pa
  666.  
  667. .fo Section 8                        93.1
  668.   Code values for the medium type field are defined in Table 8-14.1.
  669.  
  670.                                  Table 8-14.1
  671.                        Direct-access Medium Type Codes
  672.  
  673. ==============================================================================
  674.   Code Value                       Medium Type
  675.   ----------  ----------------------------------------------------------------
  676.      00H      Default medium type (currently mounted medium type)
  677.      01H      Flexible disk, single-sided; unspecified medium
  678.      02H      Flexible disk, double-sided; unspecified medium
  679.          
  680.                                  Flexible Disks
  681.               Diameter    Bit Density  Track Density  Number    Reference
  682.               mm (inch)   Bits/Radian  /mm (/inch)    Of Sides  Standard
  683.               ----------  -----------  -------------  --------  --------------
  684.      05H      200 (8.0)      6 631       1.9 (48)        1      X3.73-1980
  685.      06H      200 (8.0)      6 631       1.9 (48)        2      X3B8-140
  686.      09H      200 (8.0)     13 262       1.9 (48)        1      X3B8/78-139
  687.      0AH      200 (8.0)     13 262       1.9 (48)        2      X3.121-1984
  688.      0DH      130 (5.25)     3 979       1.9 (48)        1      X3.82-1980
  689.      12H      130 (5.25)     7 958       1.9 (48)        2      X3.125-1984
  690.      16H      130 (5.25)     7 958       3.8 (96)        2      X3.126-198X
  691.      1AH      130 (5.25)    13 262       3.8 (96)        2      DIS 8630
  692.      1EH       90 (3.5)      7 958       5.3 (135)       2      X3.137-198X
  693.  
  694.                          Direct-access Magnetic Tapes
  695.               Width                Density       Reference
  696.               mm. (Inch)   Tracks  FTPMM (FTPI)  Standard     Note
  697.               -----------  ------  ------------  -----------  ----
  698.      40H       6.3 (0.25)    12    394 (10 000)  X3B5/85-138   1
  699.      44H       6.3 (0.25)    24    394 (10 000)  X3B5/85-138   1
  700.  
  701.   80H _ FFH   Vendor unique
  702.   All others  Reserved
  703. ==============================================================================
  704. NOTES:
  705.   (1)  The referenced standard is for unrecorded miniature cartridge media.  
  706. The usage referred to here is for serial GCR recording using a format known as 
  707. QIC-100.  Since X3B5 issues a new document number for each revision of their 
  708. working draft document, please contact the Chairman of X3B5 for the latest 
  709. document number.
  710.   (2)  See appendix F for additional standards that may be applicable.
  711.  
  712.  
  713.   The block descriptor length specifies the length in bytes of all the block 
  714. descriptors.  It is equal to the number of block descriptors times eight and 
  715. does not include the vendor unique parameters, if any.  A block descriptor 
  716. length of zero indicates that no block descriptors shall be included in the 
  717. parameter list.  This condition shall not be considered as an error.
  718.  
  719.   Each block descriptor specifies the medium characteristics for all or part 
  720. of a logical unit.  Each block descriptor contains a density code, a number of 
  721. blocks, and a block length.
  722. .pa
  723.  
  724. .fo Section 8                           93.2
  725.   Code values for the density code field shall be assigned as follows:
  726.  
  727.   00H         Default (default density of medium)
  728.   01H         Flexible disk, single-density
  729.   02H         Flexible disk, double-density
  730.   03H _ 7FH   Reserved
  731.   80H _ FFH   Vendor unique
  732.  
  733.   The number of blocks field specifies the number of logical blocks on the 
  734. medium that meet the density code and block length in the block descriptor.  A 
  735. number of blocks of zero indicates that all of the remaining logical blocks of 
  736. the logical unit shall have the medium characteristics specified by the block 
  737. descriptor.
  738.  
  739.   The block length specifies the length in bytes of each logical block 
  740. described by the block descriptor.
  741. .pa
  742.  
  743. .pn 94
  744. .fo Section 8                            #
  745.   8.1.8 RESERVE Command
  746.  
  747.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  748.                               Read-Only Direct Access
  749.         Operation Code Type:  Optional
  750.              Operation Code:  16H
  751.  
  752.                                   Table 8-15
  753.                                RESERVE Command
  754.  
  755. ==============================================================================
  756.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  757. Byte |        |        |        |        |        |        |        |        |
  758. ==============================================================================
  759.  0   |                           Operation Code                              | 
  760. -----|-----------------------------------------------------------------------|
  761.  1   | Logical Unit Number      | 3rdPty | Third Party Device ID    | Extent |
  762. -----|-----------------------------------------------------------------------|
  763.  2   |                           Reservation Identification                  |
  764. -----|-----------------------------------------------------------------------|
  765.  3   |                           Extent List Length (MSB)                    |
  766. -----|-----------------------------------------------------------------------|
  767.  4   |                           Extent List Length (LSB)                    |
  768. -----|-----------------------------------------------------------------------|
  769.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  770. ==============================================================================
  771.  
  772.   The RESERVE command (Table 8-15) is used to reserve logical units or, if the 
  773. extent reservation option is implemented, extents within logical units for the 
  774. use of the initiator.  If third-party reservation option is implemented, the 
  775. logical units or extents may be reserved for another specified SCSI device.  
  776. The RESERVE and RELEASE commands provide the basic mechanism for contention 
  777. resolution in multiple-initiator systems.
  778.  
  779.      8.1.8.1 Logical Unit Reservation.  If the extent bit is zero, this 
  780. command shall request that the entire logical unit be reserved for the 
  781. exclusive use of the initiator until the reservation is superceded by another 
  782. valid RESERVE command from the initiator that made the reservation or until 
  783. released by a RELEASE command from the same initiator, by a BUS DEVICE RESET 
  784. message from any initiator, or by a "hard" RESET condition.  A logical unit 
  785. reservation shall not be granted if the logical unit or any extent is reserved 
  786. by another initiator.  It shall be permissible for an initiator to reserve a 
  787. logical unit that is currently reserved by that initiator.  If the extent bit 
  788. is zero, the reservation identification and the extent list length shall be 
  789. ignored.
  790.  
  791.   If the logical unit, or any extent within the logical unit is reserved for 
  792. another initiator, the target shall respond by either:
  793.  
  794.   (1)  returning a RESERVATION CONFLICT status
  795.  
  796.   (2)  queuing the reservation request and then disconnecting until all 
  797. previously queued reservations have been released and the logical unit is 
  798. available, then reconnecting to perform the reservation
  799.  
  800.   If, after honoring the reservation, any other initiator then subsequently 
  801.  
  802. attempts to perform any command on the reserved logical unit other than a 
  803. RESERVE command, which may be queued, or a RELEASE command, which shall be 
  804. ignored, then the command shall be rejected with RESERVATION CONFLICT status. 
  805.  
  806.      8.1.8.2 Extent Reservation (Optional).  The reservation identification 
  807. provides a means for an initiator to identify each extent reservation.  This 
  808. allows an initiator in a multiple tasking environment, to have multiple 
  809. reservations outstanding.  The reservation identification is used in the 
  810. RELEASE command to specify which reservation is to be released.  It is also 
  811. used in superceding RESERVE commands to specify which reservation is to be 
  812. superceded.
  813.  
  814.   If the extent reservation option is implemented, then the extent release 
  815. option (see 8.1.9.2) shall also be implemented.  These options permit multiple 
  816. extents within the logical unit to be reserved, each with a separate 
  817. reservation type.
  818.  
  819.   If the extent bit is one, and the extent reservation option is implemented, 
  820. then the target shall process the reservation request as follows:
  821.  
  822.   (1)  The extent list shall be checked for the number of extents in the 
  823. reservation request.  If the extent list length is zero, no reservations shall 
  824. be changed and this condition shall not be treated as an error.  If the extent 
  825. list contains more extents than are supported on the logical unit, the command 
  826. shall be terminated with a CHECK CONDITION status and the sense key shall be 
  827. set to ILLEGAL REQUEST.  If the extent list contains more extents than are 
  828. currently available on the logical unit, then the target shall either:
  829.      (a)  return RESERVATION CONFLICT status 
  830.      (b)  queue the request and disconnect until sufficient extents are made 
  831.   available.  When sufficient extents are available, the target shall 
  832.   reconnect to continue processing the request.
  833.  
  834.   (2)  The extent list shall be checked for valid extent logical block 
  835. addresses.  If any logical block address is invalid for this logical unit, the 
  836. command shall be terminated with a CHECK CONDITION status and the sense key 
  837. shall be set to ILLEGAL REQUEST.  The extent list shall be checked for invalid 
  838. extent overlaps (as defined by reservation type) with other extent descriptors 
  839. in the extent list and if invalid overlaps are found, the command shall be 
  840. terminated with a CHECK CONDITION status and the sense key shall be set to 
  841. ILLEGAL REQUEST.
  842.  
  843.   (3)  If the requested reservation does not conflict with any active or 
  844. previously requested reservation, the extents specified shall be reserved 
  845. until superceded by another valid RESERVE command from the initiator that made 
  846. the reservation or until released by a RELEASE command from the same 
  847. initiator, by a BUS DEVICE RESET message from any initiator, or by a "hard" 
  848. RESET condition.  If either of the last two conditions occur, the next command 
  849. >From each initiator shall be terminated with a CHECK CONDITION status and the 
  850. sense key shall be set to UNIT ATTENTION.
  851.  
  852.   (4)  If the reservation request conflicts with a reservation already active 
  853. or a reservation request that is already queued, then the target shall either:
  854.      (a)  return RESERVATION CONFLICT status
  855.      (b)  queue the reservation and disconnect until it is allowed to be 
  856.   active.  Reservations are only made active when all extents are free from 
  857.   conflict with active or previously queued reservations.
  858.  
  859.  
  860.   If the extent bit is one, and the extent reservation option is not 
  861. implemented, then the RESERVE command shall be rejected with CHECK CONDITION 
  862. status and the sense key shall be set to ILLEGAL REQUEST.
  863.  
  864.                                   Table 8-16
  865.                       Data Format of Extent Descriptors
  866.  
  867. ==============================================================================
  868.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  869. Byte |        |        |        |        |        |        |        |        |
  870. ==============================================================================
  871.  0   |         Reserved                           | RelAdr | Reservation Type|
  872. -----|-----------------------------------------------------------------------|
  873.  1   |                           Number of Blocks (MSB)                      |
  874. -----|-----------------------------------------------------------------------|
  875.  2   |                           Number of Blocks                            |
  876. -----|-----------------------------------------------------------------------|
  877.  3   |                           Number of Blocks (LSB)                      |
  878. -----|-----------------------------------------------------------------------|
  879.  4   |                           Logical Block Address (MSB)                 |
  880. -----|-----------------------------------------------------------------------|
  881.  5   |                           Logical Block Address                       |
  882. -----|-----------------------------------------------------------------------|
  883.  6   |                           Logical Block Address                       |
  884. -----|-----------------------------------------------------------------------|
  885.  7   |                           Logical Block Address (LSB)                 |
  886. ==============================================================================
  887.  
  888.   The size of the extent list shall be defined by the extent list length 
  889. parameter.  The extent list shall consist of zero or more descriptors as shown 
  890. in Table 8-16.  Each extent descriptor defines an extent beginning at the 
  891. specified logical block address for the specified number of blocks.  If the 
  892. number of blocks is zero, the extent shall begin at the specified logical 
  893. block address and continue through the last logical block address on the 
  894. logical unit.
  895.  
  896.   The reservation type field shall determine the type of reservation to be 
  897. effected for each extent.  Four types of reservations are possible as follows:
  898.  
  899.   DB(1) DB(0)  Reservation Type
  900.   ----- -----  ----------------
  901.     1     0    Read Exclusive 
  902.     0     1    Write Exclusive
  903.     1     1    Exclusive Access
  904.     0     0    Read Shared
  905.  
  906. Read Exclusive.  While this reservation is active, no other initiator shall be 
  907. permitted read operations to the indicated extent.  This reservation shall not 
  908. inhibit write operations from any initiator or conflict with a write exclusive 
  909. reservation; however, read exclusive, exclusive access, and read shared 
  910. reservations that overlap this extent shall conflict with this reservation.
  911.  
  912. Write Exclusive.  While this reservation is active, no other initiator shall 
  913. be permitted write operations to the indicated extent.  This reservation shall 
  914. not inhibit read operations from any initiator or conflict with a read 
  915.  
  916. exclusive reservation from any initiator.  This reservation shall conflict 
  917. with write exclusive, exclusive access, and read shared reservations that 
  918. overlap this extent.
  919.  
  920. Exclusive Access.  While this reservation is active, no other initiator shall 
  921. be permitted any access to the indicated extent.  All reservation types that 
  922. overlap this extent shall conflict with this reservation.
  923.  
  924. Read Shared.  While this reservation is active, no write operations shall be 
  925. permitted by any initiator to the indicated extent.  This reservation shall 
  926. not inhibit read operations from any initiator or conflict with a read shared 
  927. reservation.  Read exclusive, write exclusive, and exclusive access 
  928. reservations that overlap with this extent shall conflict with this 
  929. reservation.
  930.  
  931.   If the relative address bit is one, the logical block address shall be 
  932. treated as a two's complement displacement.  This displacement shall be added 
  933. to the logical block address last accessed on the logical unit to form the 
  934. logical block address for this extent.  This feature is only available when 
  935. linking commands and requires that a previous command in the linked group has 
  936. accessed a logical block on the logical unit; if not, the RESERVE command 
  937. shall be terminated with a CHECK CONDITION status and the sense key shall be 
  938. set to ILLEGAL REQUEST.
  939.  
  940.   If an initiator attempts a command to a logical block that has been 
  941. reserved and that access is prohibited by the reservation, the command shall 
  942. not be performed and the command shall be terminated with a RESERVATION 
  943. CONFLICT status.  If a reservation conflict precludes any part of the command, 
  944. none of the command shall be performed.  COPY commands shall be terminated 
  945. with a CHECK CONDITION status and the sense key shall be set to DATA PROTECT 
  946. if any part of the copy operation is prohibited by an active reservation.  If 
  947. any extent in a logical unit is reserved in any way, a FORMAT UNIT command 
  948. shall be rejected with a RESERVATION CONFLICT status.
  949.  
  950.      8.1.8.3 Third Party Reservation (Optional).  The third-party reservation 
  951. option for the RESERVE command allows an initiator to reserve a logical unit 
  952. or extents within a logical unit for another SCSI device.  This option is 
  953. intended for use in multiple-initiator systems that use the COPY command.  Any 
  954. target that implements the third-party reservation option shall also implement 
  955. the third-party release option (see 8.1.9.3).
  956.  
  957.   If the third-party (3rdPty) bit is zero, then the third-party reservation 
  958. option is not requested.  If the 3rdPty bit is one and the third-party 
  959. reservation option is implemented, then the RESERVE command shall reserve the 
  960. specified logical unit or extents for the SCSI device specified in the third-
  961. party device ID field.  The target shall preserve the reservation until it is 
  962. superceded by another valid RESERVE command from the initiator that made the 
  963. reservation or until it is released by the same initiator, by a BUS DEVICE 
  964. RESET message from any initiator, or a "hard" RESET condition.  The target 
  965. shall ignore any attempt to release the reservation made by any other 
  966. initiator.
  967.  
  968.   If the 3rdPty bit is one and the third-party reservation option is not 
  969. implemented, then the target shall reject the RESERVE command with a CHECK 
  970. CONDITION status and the sense key shall be set to ILLEGAL REQUEST. 
  971.  
  972.  
  973.      8.1.8.4 Superceding Reservations.  An initiator that holds a current 
  974. reservation may modify that reservation by issuing another RESERVE command to 
  975. the same logical unit and, if the extent bit is one, using the same 
  976. reservation identification.  The superceding RESERVE command shall release the 
  977. previous reservation state when the new reservation request is granted.  The 
  978. previous reservation shall not be modified if the new reservation request 
  979. cannot be granted.  If the superceding reservation cannot be granted because 
  980. of conflicts with a previous active reservation (other than the reservation 
  981. being superceded), then the target shall either:
  982.  
  983.   (1)  return RESERVATION CONFLICT status
  984.  
  985.   (2)  queue the reservation request and disconnect until it is allowed to be 
  986. active.  The reservation request shall be made active when it is free from 
  987. conflict with all active reservations.  A superceding reservation takes 
  988. priority over any previously queued reservation request.
  989.  
  990. IMPLEMENTORS NOTE:  Superceding reservations are principally intended to allow 
  991. the SCSI device ID to be changed on a reservation using the third-party 
  992. reservation option.  This capability is necessary for certain situations when 
  993. using the COPY command.
  994.  
  995.   8.1.9 RELEASE Command
  996.  
  997.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  998.                               Read-Only Direct Access
  999.         Operation Code Type:  Optional
  1000.              Operation Code:  17H
  1001.  
  1002.                                   Table 8-17
  1003.                                RELEASE Command
  1004.  
  1005. ==============================================================================
  1006.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1007. Byte |        |        |        |        |        |        |        |        |
  1008. ==============================================================================
  1009.  0   |                           Operation Code                              | 
  1010. -----|-----------------------------------------------------------------------|
  1011.  1   | Logical Unit Number      | 3rdPty | Third Party Device ID    | Extent |
  1012. -----|-----------------------------------------------------------------------|
  1013.  2   |                           Reservation Identification                  |
  1014. -----|-----------------------------------------------------------------------|
  1015.  3   |                           Reserved                                    |
  1016. -----|-----------------------------------------------------------------------|
  1017.  4   |                           Reserved                                    |
  1018. -----|-----------------------------------------------------------------------|
  1019.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1020. ==============================================================================
  1021.  
  1022.   The RELEASE command (Table 8-17) is used to release previously reserved 
  1023. logical units, or, if the extent release option is implemented, previously 
  1024. reserved extents within logical units.  It is not an error for an initiator to 
  1025. attempt to release a reservation that is not currently active.  In this case, 
  1026. the target returns GOOD status without altering any other reservation.
  1027.  
  1028.      8.1.9.1 Logical Unit Release.  If the extent bit is zero, this command 
  1029.  
  1030. shall cause the target to terminate all logical unit and extent reservations 
  1031. that are active from the initiator to the specified logical unit.
  1032.  
  1033.      8.1.9.2 Extent Release (Optional).  If the extent bit is one and the 
  1034. extent release option is not implemented, then the RELEASE command shall be 
  1035. terminated with a CHECK CONDITION status and the sense key shall be set to 
  1036. ILLEGAL REQUEST.  This option shall be implemented if the extent reservation 
  1037. option (see 8.1.8.2) is implemented.
  1038.  
  1039.   If the extent bit is one and the extent release option is implemented, this 
  1040. command shall cause any reservation from the requesting initiator with a 
  1041. matching reservation identification to be terminated.  Other reservations from 
  1042. the requesting initiator shall remain in effect.
  1043.  
  1044.   If the logical unit queues reservations, then when a RELEASE command is 
  1045. processed, the reservation queue shall be examined on a first-in first-out 
  1046. basis.  If there are one or more reservations in the queue that can now be 
  1047. activated, the logical unit shall first disconnect from the initiator.  It 
  1048. shall then successively reconnect with each initiator whose queued reservation 
  1049. may now be activated.  A queued reservation request shall not be activated if 
  1050. it conflicts with any previously queued reservation.  After first granting all 
  1051. possible queued reservations, the unit shall reconnect with the initiator of 
  1052. the RELEASE command to terminate the command.
  1053.  
  1054.   If a logical unit that queues reservations receives a RELEASE command from a 
  1055. second initiator while it is disconnected during processing of a previous 
  1056. RELEASE command, it shall then disconnect from the second initiator and 
  1057. suspend processing of the second RELEASE until after reconnection with the 
  1058. first initiator, or until it is determined that reconnection has failed.
  1059.  
  1060.      8.1.9.3 Third Party Release (Optional).  The third-party release option 
  1061. for the RELEASE command allows an initiator to release a logical unit or 
  1062. extents within a logical unit that were previously reserved using the third-
  1063. party reservation option (see 8.1.8.3).  This option shall be implemented if 
  1064. the third-party reservation option is implemented.  This option is intended 
  1065. for use in multiple-initiator systems that use the COPY command.
  1066.  
  1067.   If the third-party (3rdPty) bit is zero, then the third-party release option 
  1068. is not requested.  If the 3rdPty bit is one and the target implements the 
  1069. third-party release option, then the target shall release the specified 
  1070. logical unit or extents, but only if the reservation was made using the third-
  1071. party reservation option by the initiator that is requesting the release for 
  1072. the same SCSI device as specified in the third-party device ID field.
  1073.  
  1074.   If the 3rdPty bit is one and the target does not implement the third-party 
  1075. release option, then the target shall terminate the command with a CHECK 
  1076. CONDITION status and the sense key shall be set to ILLEGAL REQUEST.
  1077. .pa
  1078.  
  1079.   8.1.10 MODE SENSE Command
  1080.  
  1081.      Peripheral Device Type:  Direct Access
  1082.         Operation Code Type:  Optional
  1083.              Operation Code:  1AH
  1084.  
  1085.                                   Table 8-18
  1086.                               MODE SENSE Command
  1087.  
  1088. ==============================================================================
  1089.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1090. Byte |        |        |        |        |        |        |        |        |
  1091. ==============================================================================
  1092.  0   |                           Operation Code                              | 
  1093. -----|-----------------------------------------------------------------------|
  1094.  1   | Logical Unit Number      |                  Reserved                  |
  1095. -----|-----------------------------------------------------------------------|
  1096.  2   |                           Reserved                                    |
  1097. -----|-----------------------------------------------------------------------|
  1098.  3   |                           Reserved                                    |
  1099. -----|-----------------------------------------------------------------------|
  1100.  4   |                           Allocation Length                           |
  1101. -----|-----------------------------------------------------------------------|
  1102.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1103. ==============================================================================
  1104.  
  1105.   The MODE SENSE command (Table 8-18) provides a means for a target to report 
  1106. its medium, logical unit, or peripheral device parameters to the initiator.  
  1107. It is a complementary command to the MODE SELECT command for support of medium 
  1108. that may contain multiple block lengths or densities.
  1109.  
  1110.   The allocation length specifies the number of bytes that the initiator has 
  1111. allocated for returned MODE SENSE data.  An allocation length of zero 
  1112. indicates that no MODE SENSE data shall be transferred.  This condition shall 
  1113. not be considered as an error.  Any other value indicates the maximum number 
  1114. of bytes that shall be transferred.  The target shall terminate the DATA IN 
  1115. phase when allocation length bytes have been transferred or when all available 
  1116. MODE SENSE data have been transferred to the initiator, whichever is less.
  1117.  
  1118.   The MODE SENSE data (Table 8-19) contains a four-byte header, followed by 
  1119. zero or more eight-byte block descriptors, followed by the vendor unique 
  1120. parameters, if any. 
  1121. .pa
  1122.  
  1123.                                   Table 8-19
  1124.                                MODE SENSE Data
  1125.  
  1126. ==============================================================================
  1127.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1128. Byte |        |        |        |        |        |        |        |        |
  1129. ==============================================================================
  1130.  0   |                           Sense Data Length                           |
  1131. -----|-----------------------------------------------------------------------|
  1132.  1   |                           Medium Type                                 |
  1133. -----|-----------------------------------------------------------------------|
  1134.  2   |   WP   |                  Reserved                                    |
  1135. -----|-----------------------------------------------------------------------|
  1136.  3   |                           Block Descriptor Length                     |
  1137. ==============================================================================
  1138.      |                        Block Descriptor(s)                            |
  1139. ==============================================================================
  1140.  0   |                           Density Code                                |
  1141. -----|-----------------------------------------------------------------------|
  1142.  1   |                           Number of Blocks (MSB)                      |
  1143. -----|-----------------------------------------------------------------------|
  1144.  2   |                           Number of Blocks                            |
  1145. -----|-----------------------------------------------------------------------|
  1146.  3   |                           Number of Blocks (LSB)                      |
  1147. -----|-----------------------------------------------------------------------|
  1148.  4   |                           Reserved                                    |
  1149. -----|-----------------------------------------------------------------------|
  1150.  5   |                           Block Length (MSB)                          |
  1151. -----|-----------------------------------------------------------------------|
  1152.  6   |                           Block Length                                |
  1153. -----|-----------------------------------------------------------------------|
  1154.  7   |                           Block Length (LSB)                          |
  1155. ==============================================================================
  1156.      |                        Vendor Unique Parameter(s)                     |
  1157. ==============================================================================
  1158. 0 _ n|                           Vendor Unique                               |
  1159.      |                           Parameter Byte(s)                           |
  1160. ==============================================================================
  1161.  
  1162.   The sense data length specifies the length in bytes of the following MODE 
  1163. SENSE data that is available to be transferred during the DATA IN phase.  The 
  1164. sense data length does not include itself.
  1165.  
  1166.   Code values for the medium type field are defined in Table 8-14.1.
  1167.  
  1168.   A write protected (WP) bit of zero indicates that the medium is write 
  1169. enabled.  A WP bit of one indicates that the medium is write protected.
  1170.  
  1171.   The block descriptor length specifies the length in bytes of all the block 
  1172. descriptors.  It is equal to the number of block descriptors times eight and 
  1173. does not include the vendor unique parameters, if any.  A block descriptor 
  1174. length of zero indicates that no block descriptors shall be included in the 
  1175. parameter list.  This condition shall not be considered as an error.
  1176.  
  1177.   Each block descriptor specifies the medium characteristics for all or part 
  1178. of a logical unit.  Each block descriptor contains a density code, a number of 
  1179.  
  1180. blocks, and a block length.
  1181.  
  1182.   Code values for the density code field shall be assigned as follows:
  1183.  
  1184.   00H         Default (only one density supported)
  1185.   01H         Flexible disk, single density
  1186.   02H         Flexible disk, double density
  1187.   03H _ 7FH   Reserved
  1188.   80H _ FFH   Vendor unique
  1189.  
  1190.   The number of blocks field specifies the number of logical blocks of the 
  1191. medium that meets the density code and block length in the block descriptor.  
  1192. A number of blocks of zero indicates that all of the remaining logical blocks 
  1193. of the logical unit have the medium characteristics specified by the block 
  1194. descriptor.
  1195.  
  1196.   The block length specifies the length in bytes of each logical block.
  1197.  
  1198.   8.1.11 START/STOP UNIT Command
  1199.  
  1200.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1201.                               Read-Only Direct Access
  1202.         Operation Code Type:  Optional
  1203.              Operation Code:  1BH
  1204.  
  1205.                                   Table 8-20
  1206.                            START/STOP UNIT Command
  1207.  
  1208. ==============================================================================
  1209.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1210. Byte |        |        |        |        |        |        |        |        |
  1211. ==============================================================================
  1212.  0   |                           Operation Code                              | 
  1213. -----|-----------------------------------------------------------------------|
  1214.  1   | Logical Unit Number      |                  Reserved         | Immed  |
  1215. -----|-----------------------------------------------------------------------|
  1216.  2   |                           Reserved                                    |
  1217. -----|-----------------------------------------------------------------------|
  1218.  3   |                           Reserved                                    |
  1219. -----|-----------------------------------------------------------------------|
  1220.  4   |                           Reserved                           |  Start |
  1221. -----|-----------------------------------------------------------------------|
  1222.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1223. ==============================================================================
  1224.  
  1225.   The START/STOP UNIT command (Table 8-20) requests that the target enable or 
  1226. disable the logical unit for further operations.
  1227.  
  1228.   An immediate (Immed) bit of one indicates that status shall be returned as 
  1229. soon as the operation is initiated.  An Immed bit of zero indicates that 
  1230. status shall be returned after the operation is completed.
  1231.  
  1232.   A start bit of one requests the logical unit be made ready for use.  A start 
  1233. bit of zero requests that the logical unit be stopped.
  1234. .pa
  1235.  
  1236.   8.1.12 PREVENT/ALLOW MEDIUM REMOVAL Command
  1237.  
  1238.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1239.                               Read-Only Direct Access
  1240.         Operation Code Type:  Optional
  1241.              Operation Code:  1EH
  1242.  
  1243.                                   Table 8-21
  1244.                      PREVENT/ALLOW MEDIUM REMOVAL Command
  1245.  
  1246. ==============================================================================
  1247.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1248. Byte |        |        |        |        |        |        |        |        |
  1249. ==============================================================================
  1250.  0   |                           Operation Code                              | 
  1251. -----|-----------------------------------------------------------------------|
  1252.  1   | Logical Unit Number      |                  Reserved                  |
  1253. -----|-----------------------------------------------------------------------|
  1254.  2   |                           Reserved                                    |
  1255. -----|-----------------------------------------------------------------------|
  1256.  3   |                           Reserved                                    |
  1257. -----|-----------------------------------------------------------------------|
  1258.  4   |                           Reserved                           | Prevent|
  1259. -----|-----------------------------------------------------------------------|
  1260.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1261. ==============================================================================
  1262.  
  1263.   The PREVENT/ALLOW MEDIUM REMOVAL command (Table 8-21) requests that the 
  1264. target enable or disable the removal of the medium in the logical unit.
  1265.  
  1266.   A prevent bit of one shall inhibit mechanisms that normally allow removal of 
  1267. the medium.  A prevent bit of zero shall allow removal of the medium.
  1268.  
  1269.   This prevention of medium removal condition shall terminate upon receipt of 
  1270. a PREVENT/ALLOW MEDIUM REMOVAL command with the prevent bit set to zero, or by 
  1271. the receipt of a BUS DEVICE RESET message from any initiator or by a "hard" 
  1272. RESET condition.
  1273. .pa
  1274.  
  1275. 8.2 Group 1 Commands for Direct-Access Devices.  The Group 1 commands for 
  1276. direct-access devices shall be as shown in Table 8-22.
  1277.  
  1278.                                   Table 8-22
  1279.                   Group 1 Commands for Direct-Access Devices
  1280.  
  1281. ==============================================================================
  1282. Operation
  1283.   Code      Type   Command Name                       Section
  1284. ------------------------------------------------------------------------------
  1285.    20H       V
  1286.    21H       V
  1287.    22H       V
  1288.    23H       V
  1289.    24H       V
  1290.    25H       E     READ CAPACITY                      8.2.1
  1291.    26H       V
  1292.    27H       V
  1293.    28H       E     READ                               8.2.2
  1294.    29H       V
  1295.    2AH       E     WRITE                              8.2.3
  1296.    2BH       O     SEEK                               8.2.4
  1297.    2CH       V
  1298.    2DH       V
  1299.    2EH       O     WRITE AND VERIFY                   8.2.5
  1300.    2FH       O     VERIFY                             8.2.6
  1301.    30H       O     SEARCH DATA HIGH                   8.2.7.1
  1302.    31H       O     SEARCH DATA EQUAL                  8.2.7.2
  1303.    32H       O     SEARCH DATA LOW                    8.2.7.3
  1304.    33H       O     SET LIMITS                         8.2.8
  1305.    34H       R
  1306.    35H       R
  1307.    36H       R
  1308.    37H       R
  1309.    38H       R
  1310.    39H       O     COMPARE                            7.2.1
  1311.    3AH       O     COPY AND VERIFY                    7.2.2
  1312.    3BH       R
  1313.    3CH       R
  1314.    3DH       R
  1315.    3EH       R
  1316.    3FH       R
  1317. ==============================================================================
  1318.  
  1319. Key: M  =  Command implementation is mandatory.
  1320.      E  =  Command implementation is required for SCSI devices that support 
  1321.            device-independent self-configuring software.
  1322.      O  =  Command implementation is optional.
  1323.      R  =  Operation code is reserved for future standardization.
  1324.      V  =  Operation code is available for vendor unique commands.
  1325. .pa
  1326.  
  1327.   8.2.1 READ CAPACITY Command
  1328.  
  1329.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1330.                               Read-Only Direct Access
  1331.         Operation Code Type:  Extended
  1332.              Operation Code:  25H
  1333.  
  1334.                                   Table 8-23
  1335.                             READ CAPACITY Command
  1336.  
  1337. ==============================================================================
  1338.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1339. Byte |        |        |        |        |        |        |        |        |
  1340. ==============================================================================
  1341.  0   |                           Operation Code                              | 
  1342. -----|-----------------------------------------------------------------------|
  1343.  1   | Logical Unit Number      |             Reserved              | RelAdr |
  1344. -----|-----------------------------------------------------------------------|
  1345.  2   |                           Logical Block Address (MSB)                 |
  1346. -----|-----------------------------------------------------------------------|
  1347.  3   |                           Logical Block Address                       |
  1348. -----|-----------------------------------------------------------------------|
  1349.  4   |                           Logical Block Address                       |
  1350. -----|-----------------------------------------------------------------------|
  1351.  5   |                           Logical Block Address (LSB)                 |
  1352. -----|-----------------------------------------------------------------------|
  1353.  6   |                           Reserved                                    |
  1354. -----|-----------------------------------------------------------------------|
  1355.  7   |                           Reserved                                    |
  1356. -----|-----------------------------------------------------------------------|
  1357.  8   | Vendor Unique   |         Reserved                           |  PMI   |
  1358. -----|-----------------------------------------------------------------------|
  1359.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1360. ==============================================================================
  1361.  
  1362.   The READ CAPACITY command (Table 8-23) provides a means for the initiator to 
  1363. request information regarding the capacity of the logical unit.
  1364.  
  1365.   A partial medium indicator (PMI) bit of zero indicates that the information 
  1366. returned in the READ CAPACITY data shall be the logical block address and 
  1367. block length (in bytes) of the last logical block of the logical unit.  The 
  1368. logical block address in the command descriptor block shall be to set zero for 
  1369. this option.
  1370.  
  1371.   A PMI bit of one indicates that the information returned shall be the 
  1372. logical block address and block length (in bytes) of the last logical block 
  1373. address after which a substantial delay in data transfer will be encountered.  
  1374. This logical block address shall be greater than or equal to the logical block 
  1375. address specified in the command descriptor block.  (Implementors note:  This 
  1376. function is intended to assist storage management software in determining 
  1377. whether there is sufficient space on the current track, cylinder, etc. to 
  1378. contain a frequently accessed data structure such as a file directory or file 
  1379. index.)
  1380.  
  1381.   The eight bytes of READ CAPACITY data shown in Table 8-24 shall be sent 
  1382. during the DATA IN phase of the command.
  1383.  
  1384.                                   Table 8-24
  1385.                               READ CAPACITY Data
  1386.  
  1387. ==============================================================================
  1388. Byte |                        Description                                    |
  1389. ==============================================================================
  1390.  0   |                           Logical Block Address (MSB)                 |
  1391. -----|-----------------------------------------------------------------------|
  1392.  1   |                           Logical Block Address                       |
  1393. -----|-----------------------------------------------------------------------|
  1394.  2   |                           Logical Block Address                       |
  1395. -----|-----------------------------------------------------------------------|
  1396.  3   |                           Logical Block Address (LSB)                 |
  1397. -----|-----------------------------------------------------------------------|
  1398.  4   |                           Block Length (MSB)                          |
  1399. -----|-----------------------------------------------------------------------|
  1400.  5   |                           Block Length                                |
  1401. -----|-----------------------------------------------------------------------|
  1402.  6   |                           Block Length                                |
  1403. -----|-----------------------------------------------------------------------|
  1404.  7   |                           Block Length (LSB)                          |
  1405. ==============================================================================
  1406.  
  1407.   8.2.2 READ Command
  1408.  
  1409.      Peripheral Device Type:  Direct Access
  1410.         Operation Code Type:  Extended
  1411.              Operation Code:  28H
  1412.  
  1413.                                   Table 8-25
  1414.                                  READ Command
  1415.  
  1416. ==============================================================================
  1417.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1418. Byte |        |        |        |        |        |        |        |        |
  1419. ==============================================================================
  1420.  0   |                           Operation Code                              | 
  1421. -----|-----------------------------------------------------------------------|
  1422.  1   | Logical Unit Number      |             Reserved              | RelAdr |
  1423. -----|-----------------------------------------------------------------------|
  1424.  2   |                           Logical Block Address (MSB)                 |
  1425. -----|-----------------------------------------------------------------------|
  1426.  3   |                           Logical Block Address                       |
  1427. -----|-----------------------------------------------------------------------|
  1428.  4   |                           Logical Block Address                       |
  1429. -----|-----------------------------------------------------------------------|
  1430.  5   |                           Logical Block Address (LSB)                 |
  1431. -----|-----------------------------------------------------------------------|
  1432.  6   |                           Reserved                                    |
  1433. -----|-----------------------------------------------------------------------|
  1434.  7   |                           Transfer Length (MSB)                       |
  1435. -----|-----------------------------------------------------------------------|
  1436.  8   |                           Transfer Length (LSB)                       |
  1437. -----|-----------------------------------------------------------------------|
  1438.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1439. ==============================================================================
  1440.  
  1441.   The READ command (Table 8-25) requests that the target transfer data to the 
  1442. initiator.
  1443.  
  1444.   The logical block address specifies the logical block at which the read 
  1445. operation shall begin.
  1446.  
  1447.   The transfer length specifies the number of contiguous logical blocks of 
  1448. data that shall be transferred.  A transfer length of zero indicates that no 
  1449. logical blocks shall be transferred.  This condition shall not be considered 
  1450. as an error.  Any other value indicates the number of logical blocks that 
  1451. shall be transferred.
  1452.  
  1453.   The most recent data value written in the addressed logical block shall be 
  1454. returned.
  1455.  
  1456.   This command shall be terminated with a RESERVATION CONFLICT status if any 
  1457. reservation access conflict (see 8.1.8) exists and no data shall be read.
  1458.  
  1459.   If any of the following conditions occur, this command shall return a CHECK 
  1460. CONDITION status and the sense key shall be set as indicated in the following 
  1461. table.  This table does not provide an exhaustive enumeration of all 
  1462. conditions that may cause the CHECK CONDITION status.
  1463.  
  1464.  
  1465. Condition                                         Sense Key
  1466. ----------------------------------------------    ----------------------------
  1467. Invalid logical block address                     ILLEGAL REQUEST (see note)
  1468.  
  1469. Target reset or medium change
  1470. since last command from this initiator            UNIT ATTENTION
  1471.  
  1472. Unrecovered read error                            MEDIUM ERROR
  1473.  
  1474. Recoverable read error                            RECOVERED ERROR
  1475.  
  1476. Overrun or other error that might
  1477. be resolved by repeating the command              ABORTED COMMAND
  1478.  
  1479.  
  1480. NOTE:  The extended sense information bytes shall be set to the logical block 
  1481. address of the first invalid address. 
  1482. .pa
  1483.  
  1484.   8.2.3 WRITE Command
  1485.  
  1486.      Peripheral Device Type:  Direct Access
  1487.         Operation Code Type:  Extended
  1488.              Operation Code:  2AH
  1489.  
  1490.                                   Table 8-26
  1491.                                 WRITE Command
  1492.  
  1493. ==============================================================================
  1494.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1495. Byte |        |        |        |        |        |        |        |        |
  1496. ==============================================================================
  1497.  0   |                           Operation Code                              | 
  1498. -----|-----------------------------------------------------------------------|
  1499.  1   | Logical Unit Number      |             Reserved              | RelAdr |
  1500. -----|-----------------------------------------------------------------------|
  1501.  2   |                           Logical Block Address (MSB)                 |
  1502. -----|-----------------------------------------------------------------------|
  1503.  3   |                           Logical Block Address                       |
  1504. -----|-----------------------------------------------------------------------|
  1505.  4   |                           Logical Block Address                       |
  1506. -----|-----------------------------------------------------------------------|
  1507.  5   |                           Logical Block Address (LSB)                 |
  1508. -----|-----------------------------------------------------------------------|
  1509.  6   |                           Reserved                                    |
  1510. -----|-----------------------------------------------------------------------|
  1511.  7   |                           Transfer Length (MSB)                       |
  1512. -----|-----------------------------------------------------------------------|
  1513.  8   |                           Transfer Length (LSB)                       |
  1514. -----|-----------------------------------------------------------------------|
  1515.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1516. ==============================================================================
  1517.  
  1518.   The WRITE command (Table 8-26) requests that the target write the data 
  1519. transferred by the initiator to the medium.
  1520.  
  1521.   The logical block address specifies the logical block at which the write 
  1522. operation shall begin.
  1523.  
  1524.   The transfer length specifies the number of contiguous logical blocks of 
  1525. data that shall be transferred.  A transfer length of zero indicates that no 
  1526. logical blocks shall be transferred.  This condition shall not be considered 
  1527. as an error and no data shall be written.  Any other value indicates the 
  1528. number of logical blocks that shall be transferred.
  1529.  
  1530.   This command shall be terminated with a RESERVATION CONFLICT status if any 
  1531. reservation access conflict (see 8.1.8) exists and no data shall be written.
  1532.  
  1533.   If any of the following conditions occur, this command shall be terminated 
  1534. with a CHECK CONDITION status and the sense key shall be set as indicated in 
  1535. the following table.  This table does not provide an exhaustive enumeration of 
  1536. all conditions that may cause the CHECK CONDITION status.
  1537. .pa
  1538.  
  1539. Condition                                         Sense Key
  1540. ----------------------------------------------    ----------------------------
  1541. Invalid logical block address                     ILLEGAL REQUEST (see note)
  1542.  
  1543. Target reset or medium change since the
  1544. last command from this initiator                  UNIT ATTENTION
  1545.  
  1546. Overrun or other error that might
  1547. be resolved by repeating the command              ABORTED COMMAND
  1548.  
  1549. NOTE:  The extended sense information bytes shall be set to the logical block 
  1550. address of the first invalid address.  In this case,  no data shall be 
  1551. written on the logical unit. 
  1552.  
  1553.   8.2.4 SEEK Command
  1554.  
  1555.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1556.                               Read-Only Direct Access
  1557.         Operation Code Type:  Optional
  1558.              Operation Code:  2BH
  1559.  
  1560.                                   Table 8-27
  1561.                                  SEEK Command
  1562.  
  1563. ==============================================================================
  1564.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1565. Byte |        |        |        |        |        |        |        |        |
  1566. ==============================================================================
  1567.  0   |                           Operation Code                              | 
  1568. -----|-----------------------------------------------------------------------|
  1569.  1   | Logical Unit Number      |                  Reserved                  |
  1570. -----|-----------------------------------------------------------------------|
  1571.  2   |                           Logical Block Address (MSB)                 |
  1572. -----|-----------------------------------------------------------------------|
  1573.  3   |                           Logical Block Address                       |
  1574. -----|-----------------------------------------------------------------------|
  1575.  4   |                           Logical Block Address                       |
  1576. -----|-----------------------------------------------------------------------|
  1577.  5   |                           Logical Block Address (LSB)                 |
  1578. -----|-----------------------------------------------------------------------|
  1579.  6   |                           Reserved                                    |
  1580. -----|-----------------------------------------------------------------------|
  1581.  7   |                           Reserved                                    |
  1582. -----|-----------------------------------------------------------------------|
  1583.  8   |                           Reserved                                    |
  1584. -----|-----------------------------------------------------------------------|
  1585.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1586. ==============================================================================
  1587.  
  1588.   The SEEK command (Table 8-27) requests that the logical unit seek to the 
  1589. specified logical block address.
  1590. .pa
  1591.  
  1592.   8.2.5 WRITE AND VERIFY Command
  1593.  
  1594.      Peripheral Device Type:  Direct Access
  1595.         Operation Code Type:  Optional
  1596.              Operation Code:  2EH
  1597.  
  1598.                                   Table 8-28
  1599.                            WRITE AND VERIFY Command
  1600.  
  1601. ==============================================================================
  1602.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1603. Byte |        |        |        |        |        |        |        |        |
  1604. ==============================================================================
  1605.  0   |                           Operation Code                              | 
  1606. -----|-----------------------------------------------------------------------|
  1607.  1   | Logical Unit Number      |             Reserved     | BytChk | RelAdr |
  1608. -----|-----------------------------------------------------------------------|
  1609.  2   |                           Logical Block Address (MSB)                 |
  1610. -----|-----------------------------------------------------------------------|
  1611.  3   |                           Logical Block Address                       |
  1612. -----|-----------------------------------------------------------------------|
  1613.  4   |                           Logical Block Address                       |
  1614. -----|-----------------------------------------------------------------------|
  1615.  5   |                           Logical Block Address (LSB)                 |
  1616. -----|-----------------------------------------------------------------------|
  1617.  6   |                           Reserved                                    |
  1618. -----|-----------------------------------------------------------------------|
  1619.  7   |                           Transfer Length (MSB)                       |
  1620. -----|-----------------------------------------------------------------------|
  1621.  8   |                           Transfer Length (LSB)                       |
  1622. -----|-----------------------------------------------------------------------|
  1623.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1624. ==============================================================================
  1625.  
  1626.   The WRITE AND VERIFY command (Table 8-28) requests that the target write the 
  1627. data transferred from the initiator to the medium and then verify that the 
  1628. data is correctly written.
  1629.  
  1630.   A byte check (BytChk) bit of zero causes the verification to be simply a 
  1631. medium verification (CRC, ECC, etc).  A BytChk bit of one causes a byte-by-
  1632. byte compare of data written on the peripheral device and the data transferred 
  1633. >From the initiator.  If the compare is unsuccessful, the command shall be 
  1634. terminated with a CHECK CONDITION status and the sense key shall be set to 
  1635. MISCOMPARE.
  1636.  
  1637.   The logical block address specifies the logical block at which the write 
  1638. operation shall begin.
  1639.  
  1640.   The transfer length specifies the number of contiguous logical blocks of 
  1641. data that shall be transferred.  A transfer length of zero indicates that no 
  1642. logical blocks shall be transferred.  This condition shall not be considered 
  1643. as an error and no data shall be written.  Any other value indicates the 
  1644. number of logical blocks that shall be transferred.
  1645. .pa
  1646.  
  1647.   8.2.6 VERIFY Command
  1648.  
  1649.      Peripheral Device Type:  Direct Access
  1650.         Operation Code Type:  Optional
  1651.              Operation Code:  2FH
  1652.  
  1653.                                   Table 8-29
  1654.                                 VERIFY Command
  1655.  
  1656. ==============================================================================
  1657.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1658. Byte |        |        |        |        |        |        |        |        |
  1659. ==============================================================================
  1660.  0   |                           Operation Code                              | 
  1661. -----|-----------------------------------------------------------------------|
  1662.  1   | Logical Unit Number      |         Reserved         | BytChk | RelAdr |
  1663. -----|-----------------------------------------------------------------------|
  1664.  2   |                           Logical Block Address (MSB)                 |
  1665. -----|-----------------------------------------------------------------------|
  1666.  3   |                           Logical Block Address                       |
  1667. -----|-----------------------------------------------------------------------|
  1668.  4   |                           Logical Block Address                       |
  1669. -----|-----------------------------------------------------------------------|
  1670.  5   |                           Logical Block Address (LSB)                 |
  1671. -----|-----------------------------------------------------------------------|
  1672.  6   |                           Reserved                                    |
  1673. -----|-----------------------------------------------------------------------|
  1674.  7   |                           Verification Length (MSB)                   |
  1675. -----|-----------------------------------------------------------------------|
  1676.  8   |                           Verification Length (LSB)                   |
  1677. -----|-----------------------------------------------------------------------|
  1678.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1679. ==============================================================================
  1680.  
  1681.   The VERIFY command (Table 8-29) requests that the target verify the data 
  1682. written on the medium.
  1683.  
  1684.   A byte check (BytChk) bit of zero causes the verification to be simply a 
  1685. medium verification (CRC, ECC, etc).  A BytChk bit of one causes a byte-by-
  1686. byte compare of data on the medium and the data transferred from the 
  1687. initiator.  If the compare is unsuccessful, the command shall be terminated 
  1688. with a CHECK CONDITION status and the sense key shall be set to MISCOMPARE.
  1689.  
  1690.   The logical block address specifies the logical block at which the verify 
  1691. operation shall begin.
  1692.  
  1693.   The verification length specifies the number of contiguous logical blocks of 
  1694. data that shall be verified.  A transfer length of zero indicates that no 
  1695. logical blocks shall be verified.  This condition shall not be considered as 
  1696. an error.  Any other value indicates the number of logical blocks that shall 
  1697. be verified.
  1698. .pa
  1699.  
  1700.   8.2.7 SEARCH DATA Commands
  1701.  
  1702.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1703.                               Read-Only Direct Access
  1704.         Operation Code Type:  Optional
  1705.              Operation Code:  30H, 31H, or 32H
  1706.  
  1707.                                   Table 8-30
  1708.                              SEARCH DATA Commands
  1709.  
  1710. ==============================================================================
  1711.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1712. Byte |        |        |        |        |        |        |        |        |
  1713. ==============================================================================
  1714.  0   |                           Operation Code                              | 
  1715. -----|-----------------------------------------------------------------------|
  1716.  1   | Logical Unit Number      | Invert |     Reserved    | SpnDat | RelAdr |
  1717. -----|-----------------------------------------------------------------------|
  1718.  2   |                           Logical Block Address (MSB)                 |
  1719. -----|-----------------------------------------------------------------------|
  1720.  3   |                           Logical Block Address                       |
  1721. -----|-----------------------------------------------------------------------|
  1722.  4   |                           Logical Block Address                       |
  1723. -----|-----------------------------------------------------------------------|
  1724.  5   |                           Logical Block Address (LSB)                 |
  1725. -----|-----------------------------------------------------------------------|
  1726.  6   |                           Reserved                                    |
  1727. -----|-----------------------------------------------------------------------|
  1728.  7   |                           Transfer Length (MSB)                       |
  1729. -----|-----------------------------------------------------------------------|
  1730.  8   |                           Transfer Length (LSB)                       |
  1731. -----|-----------------------------------------------------------------------|
  1732.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1733. ==============================================================================
  1734.  
  1735.   The SEARCH DATA commands (Table 8-30) search one or more logical blocks for 
  1736. equality or inequality to a data pattern.  The concept of records within a 
  1737. logical block is used to allow multiple records within a logical block to be 
  1738. searched.
  1739.  
  1740.   The invert bit determines whether the search condition is to be inverted.  
  1741. See 8.2.7.1 through 8.2.7.3 for a description of the search conditions for the 
  1742. individual SEARCH DATA commands.
  1743.  
  1744.   A spanned data (SpnDat) bit of zero indicates that each record shall be 
  1745. wholly contained within a single block.  Any space at the end of a block that 
  1746. is smaller than the record length is ignored by the SEARCH DATA commands.   A 
  1747. SpnDat bit of one indicates that records span block boundaries.  Thus, a 
  1748. record may start in one block and end in the next or a subsequent block.
  1749.  
  1750.   A transfer length of zero indicates that no data shall be searched.  This 
  1751. condition shall be treated the same as an unsatisfied search. 
  1752.  
  1753.   A link bit of zero indicates a nonlinked command and if the search is 
  1754. satisfied, the command shall be terminated with a CONDITION MET status.  A 
  1755. REQUEST SENSE command can then be issued to determine the logical block 
  1756.  
  1757. address and record offset of the matching record.  If the search is not 
  1758. satisfied and no error occurs, the command shall be terminated with GOOD 
  1759. status.
  1760.  
  1761.   A link bit of one indicates a command is linked to the SEARCH DATA command 
  1762. and if the search is satisfied, CONDITION MET status is returned and the next 
  1763. command is executed.  If the RelAdr bit in the next command is one, the 
  1764. logical block address of the next command is used as a displacement from the 
  1765. logical block address at which the search was satisfied.  If a linked search 
  1766. is not satisfied, the command is terminated with a CHECK CONDITION status.  A 
  1767. REQUEST SENSE command may then be issued.
  1768.  
  1769.   A REQUEST SENSE command following a satisfied SEARCH DATA command shall:
  1770.  
  1771.   (1) Return a sense key of EQUAL if the search was satisfied by an exact 
  1772. match.  If the search was satisfied by an inequality then a sense key of NO 
  1773. SENSE shall be returned.
  1774.  
  1775.   (2) Return the valid bit set to one.
  1776.  
  1777.   (3) Return the logical block address of the logical block containing the 
  1778. first matching record in the information bytes.
  1779.  
  1780.   (4) Return the record offset of the matching record in the first four bytes 
  1781. of additional sense bytes.
  1782.  
  1783.   A REQUEST SENSE command following an unsatisfied SEARCH DATA command shall:
  1784.  
  1785.   (1) Return a sense key of NO SENSE, if no errors occurred during the command 
  1786. execution.
  1787.  
  1788.   (2) Return the valid bit set to zero.
  1789.  
  1790.   The SEARCH DATA parameter list (Table 8-31) contains a fourteen-byte header, 
  1791. followed by one or more search argument descriptors. 
  1792. .pa
  1793.  
  1794.                                   Table 8-31
  1795.                           SEARCH DATA Parameter List
  1796.  
  1797. ==============================================================================
  1798. Byte |                        Parameter List Header                          |
  1799. ==============================================================================
  1800.  0   |                           Logical Record Length (MSB)                 |
  1801. -----|-----------------------------------------------------------------------|
  1802.  1   |                           Logical Record Length                       |
  1803. -----|-----------------------------------------------------------------------|
  1804.  2   |                           Logical Record Length                       |
  1805. -----|-----------------------------------------------------------------------|
  1806.  3   |                           Logical Record Length (LSB)                 |
  1807. -----|-----------------------------------------------------------------------|
  1808.  4   |                           First Record Offset (MSB)                   |
  1809. -----|-----------------------------------------------------------------------|
  1810.  5   |                           First Record Offset                         |
  1811. -----|-----------------------------------------------------------------------|
  1812.  6   |                           First Record Offset                         |
  1813. -----|-----------------------------------------------------------------------|
  1814.  7   |                           First Record Offset (LSB)                   |
  1815. -----|-----------------------------------------------------------------------|
  1816.  8   |                           Number of Records (MSB)                     |
  1817. -----|-----------------------------------------------------------------------|
  1818.  9   |                           Number of Records                           |
  1819. -----|-----------------------------------------------------------------------|
  1820. 10   |                           Number of Records                           |
  1821. -----|-----------------------------------------------------------------------|
  1822. 11   |                           Number of Records (LSB)                     |
  1823. -----|-----------------------------------------------------------------------|
  1824. 12   |                           Search Argument Length (MSB)                |
  1825. -----|-----------------------------------------------------------------------|
  1826. 13   |                           Search Argument Length (LSB)                |
  1827. ==============================================================================
  1828.      |                        Search Argument Descriptor(s)                  |
  1829. ==============================================================================
  1830.  0   |                           Displacement (MSB)                          |
  1831. -----|-----------------------------------------------------------------------|
  1832.  1   |                           Displacement                                |
  1833. -----|-----------------------------------------------------------------------|
  1834.  2   |                           Displacement                                |
  1835. -----|-----------------------------------------------------------------------|
  1836.  3   |                           Displacement (LSB)                          |
  1837. -----|-----------------------------------------------------------------------|
  1838.  4   |                           Pattern Length (MSB)                        |
  1839. -----|-----------------------------------------------------------------------|
  1840.  5   |                           Pattern Length (LSB)                        |
  1841. -----|-----------------------------------------------------------------------|
  1842. 6 _ n|                           Pattern                                     |
  1843. ==============================================================================
  1844.  
  1845.   The logical record length field specifies the record length in bytes.
  1846.  
  1847.   The first record offset field specifies the number of bytes that shall be 
  1848. ignored in the first logical block before the search begins.  The value in the 
  1849. first record offset field shall not exceed the length of the logical block.  
  1850.  
  1851. Subsequent logical blocks shall be searched beginning with the first byte in 
  1852. the logical block.  This permits one or more records to be skipped initially.
  1853.  
  1854.   The number of records field specifies the maximum number of records that 
  1855. shall be searched by this command.  An unsatisfied search shall terminate when 
  1856. the number of records or the number of blocks (from the command descriptor 
  1857. block) have been exhausted.
  1858.  
  1859.   The search argument length specifies the length in bytes of all the search 
  1860. argument descriptors that follow.  Since the pattern length can vary, there is 
  1861. no fixed multiple of the search argument descriptor to determine the search 
  1862. argument length.
  1863.  
  1864.   The search argument descriptors specify one or more search conditions to 
  1865. execute within a single record in order to satisfy the search.  Each search 
  1866. argument descriptor is made up of a displacement, a pattern length, and a 
  1867. pattern.
  1868.  
  1869.   The displacement field specifies the displacement in bytes of the first byte 
  1870. of the data to be compared from the start of the logical record.
  1871.  
  1872.   The pattern length field specifies the length in bytes of the pattern that 
  1873. follows.
  1874.  
  1875.   The pattern specifies the data to compare to the logical record.
  1876.  
  1877.      8.2.7.1 SEARCH DATA HIGH Command.  The SEARCH DATA HIGH command 
  1878. (Table 8-30, operation code 30H) shall be satisfied by the first logical 
  1879. record searched that contains data that satisfies all of the search argument 
  1880. descriptor(s).  If the invert bit in the command descriptor block is zero, the 
  1881. search argument descriptor(s) shall be satisfied by data in the logical record 
  1882. being greater than the data in the pattern.  If the invert bit is one, the 
  1883. search argument descriptor(s) shall be satisfied by data in the logical record 
  1884. being less than or equal to the data in the pattern.  (See 8.2.7.)
  1885.  
  1886.      8.2.7.2 SEARCH DATA EQUAL Command.  The SEARCH DATA EQUAL command 
  1887. (Table8-30, operation code 31H) shall be satisfied by the first logical 
  1888. record searched that contains data that satisfies all of the search argument 
  1889. descriptor(s).  If the invert bit in the command descriptor block is zero, the 
  1890. search argument descriptor(s) shall be satisfied by data in the logical record 
  1891. being equal to the data in the pattern.  If the invert bit is one, the search 
  1892. argument descriptor(s) shall be satisfied by data in the logical record being 
  1893. not equal to the data in the pattern.  (See 8.2.7.)
  1894.  
  1895.      8.2.7.3 SEARCH DATA LOW Command.  The SEARCH DATA LOW command 
  1896. (Table 8-30, operation code 32H) shall be satisfied by the first logical 
  1897. record searched that contains data that satisfies all of the search argument 
  1898. descriptor(s).  If the invert bit in the command descriptor block is zero, the 
  1899. search argument descriptor(s) shall be satisfied by data in the logical record 
  1900. being less than the data in the pattern.  If the invert bit is one, the search 
  1901. argument descriptor(s) shall be satisfied by data in the logical record being 
  1902. greater than or equal to the data in the pattern.  (See 8.2.7.)
  1903. .pa
  1904.  
  1905.  8.2.8 SET LIMITS Command
  1906.  
  1907.      Peripheral Device Type:  Direct Access, Write-Once Read-Multiple, and
  1908.                               Read-Only Direct Access
  1909.         Operation Code Type:  Optional
  1910.              Operation Code:  33H
  1911.  
  1912.                                   Table 8-32
  1913.                               SET LIMITS Command
  1914.  
  1915. ==============================================================================
  1916.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1917. Byte |        |        |        |        |        |        |        |        |
  1918. ==============================================================================
  1919.  0   |                           Operation Code                              | 
  1920. -----|-----------------------------------------------------------------------|
  1921.  1   | Logical Unit Number      |         Reserved         | RdInh  | WrInh  |
  1922. -----|-----------------------------------------------------------------------|
  1923.  2   |                           Logical Block Address (MSB)                 |
  1924. -----|-----------------------------------------------------------------------|
  1925.  3   |                           Logical Block Address                       |
  1926. -----|-----------------------------------------------------------------------|
  1927.  4   |                           Logical Block Address                       |
  1928. -----|-----------------------------------------------------------------------|
  1929.  5   |                           Logical Block Address (LSB)                 |
  1930. -----|-----------------------------------------------------------------------|
  1931.  6   |                           Reserved                                    |
  1932. -----|-----------------------------------------------------------------------|
  1933.  7   |                           Number of Blocks (MSB)                      |
  1934. -----|-----------------------------------------------------------------------|
  1935.  8   |                           Number of Blocks (LSB)                      |
  1936. -----|-----------------------------------------------------------------------|
  1937.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1938. ==============================================================================
  1939.  
  1940.   The SET LIMITS command (Table 8-32) defines the range within which 
  1941. subsequent linked commands may operate.  A second SET LIMITS command may not 
  1942. be linked to a chain of commands in which a SET LIMITS command has already 
  1943. been issued.
  1944.  
  1945.   A read inhibit (RdInh) bit of one indicates that read operations within the 
  1946. range are inhibited.  A write inhibit (WrInh) bit of one indicates that write 
  1947. operations within the range are inhibited.
  1948.  
  1949.   The logical block address specifies the starting address for the range.  The 
  1950. number of blocks specifies the number of logical blocks within the range.  A 
  1951. number of blocks of zero indicates that the range shall extend to the last 
  1952. logical block on the logical unit.
  1953.  
  1954.   Any attempt to access outside of the restricted range or any attempt to 
  1955. perform an inhibited operation within the restricted range shall not be 
  1956. performed.  The command shall be terminated with CHECK CONDITION status and, 
  1957. if extended sense is implemented, the sense key shall be set to DATA PROTECT.  
  1958. A second SET LIMITS command within a linked list of commands shall be rejected 
  1959. with CHECK CONDITION status and, if extended sense is implemented, the sense 
  1960. key shall be set to DATA PROTECT.
  1961.  
  1962. 
  1963.  
  1964.